package com.jyw.system.domain.dto;

import com.jyw.common.core.domain.entity.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author 沈峻
 * @ClassName RegisterUserVo
 * @Description TODO
 * @Date 2023/4/18 15:06
 **/
@ApiModel("分发器用户注册实体")
@Data
public class RouterRegisterUserDto extends HospitalApiRequest {
    @ApiModelProperty("用户手机号")
    @NotBlank(message = "用户手机号不能为空")
    private String userPhone;

    @ApiModelProperty("用户系统标识")
    @NotNull(message = "用户标识不能为空")
    private Long userId;

    /**
     * 设置用户信息
     * @param user
     */
    public void setUserInfo(SysUser user) {
        setUserId(user.getUserId());
        setUserPhone(user.getPhonenumber());
    }
}
